package controllayer;

import modellayer.*;

/**
 * The Class ItemController.
 *@author Benjamin Ørskov
 *@author Lasse Lambertsen
 *@author Ole Kirk
 *@author Søren Søgaard
 */
public class ItemController {

	/** The i con. */
	private ItemContainer iCon;

	/**
	 * Instantiates a new item controller.
	 */
	public ItemController() {
		iCon = ItemContainer.getInstance();
	}

	/**
	 * Find item.
	 *
	 * @param itemID
	 *            the item id
	 * @return the item
	 */
	public Item findItem(int itemID) {
		return iCon.findItem(itemID);
	}

	/**
	 * Removes the item.
	 *
	 * @param itemID
	 *            the item id
	 */
	public void removeItem(int itemID) {
		iCon.removeItem(itemID);
	}

	/**
	 * Update item.
	 *
	 * @param tempI
	 *            the temp i
	 * @param type
	 *            the type
	 * @param newItemID
	 *            the new item id
	 * @param price
	 *            the price
	 * @param amount
	 *            the amount
	 */
	public void updateItem(Item tempI, String type, Integer newItemID,
			Double price, Integer amount) {
		iCon.updateItem(tempI, type, newItemID, price, amount);
	}

	/**
	 * Creates the item.
	 *
	 * @param type
	 *            the type
	 * @param itemID
	 *            the item id
	 * @param price
	 *            the price
	 * @param amount
	 *            the amount
	 */
	public void createItem(String type, int itemID, Double price, Integer amount) {
		iCon.createItem(type, itemID, price, amount);
	}

	/**
	 * Gets the amount.
	 *
	 * @param i
	 *            the i
	 * @return the amount
	 */
	public int getAmount(Item i) {
		return iCon.getAmount(i);
	}
}
